IOFlood dedicated server
this is the primary nerve center of my homelab, living outside of it.
IP addresses
IP Block #1 – 148.163.101.208/29
Netmask: 255.255.255.248
Gateway: 148.163.101.209
Usable IP Range: 148.163.101.210 - 148.163.101.214
IP Block #2 – 2604:6280:194:1::/64
Gateway: 2604:6280:194:1::1
Usable IP Range: 2604:6280:194:1::2 - 2604:6280:194:1:ffff:ffff:ffff:fffe
#/etc/systemd/network/enp2s0f0np0-ethernet.network based on copying ./enp2s0f1np1-ethernet.network
[Match]
Name=enp2s0f0np0
[Network]
MulticastDNS=yes
Address=148.163.101.211/29
Gateway=148.163.101.209
DNS=1.1.1.1
#/etc/systemd/network/enp2s0f1np1-ethernet.network generated by Archboot setup
[Match]
Name=enp2s0f1np1
[Network]
MulticastDNS=yes
Address=148.163.101.210/29
Gateway=148.163.101.209
DNS=1.1.1.1
arch linux setup
A simplified, opinionated, whirlwind run through the Installation guide,
Btrfs, and
systemd-boot
Arch wiki pages.
-
Download the iso.
-
Mount the iso by going to the IPMI, clicking Remote Control, Launch H5Viewer, in the top-right corner, “CD Image” file input form element and then Start Media.
“Media Boost” seems to do some network prioritization that helps (according to online searches, anyways). Turn it on. -
Then boot the iso (which took a few tries for me, the disk wasn’t always detected or successfully read during boot)
It takes a long while, as the filesystem is streamed from my desktop through the VPN, to the BMC firmware, and then to the CPU. Lots of hops, lots of places it can go wrong. -
Once booted, edit
/etc/systemd/networkd/20-ethernet.network(since it already exists) and copy the contents of one of the above examples
Thensystemctl reload networkctlto apply the network settings. Ping 1.1.1.1 to verify the network works. -
Time to format the disks! 6 partitions across the two drives:
- /dev/nvme0n1p1 - 2MiB, type: “BIOS Boot”. Came from my attempt with archboot, meh, kept for safety’s sake
- /dev/nvme0n1p2 - 2GiB, type: “EFI System”. A larger space for the /boot. I plan on putting a rescue image in there, that’s why the large space.
- /dev/nvme0n1p3 - 8GiB, type: “Linux swap”. Part 1 of the swap space for the system. Total 16GiB when done, spread across the two disks.
- /dev/nvme0n1p4 - the rest (~884GiB), type: “Linux filesystem”. The rest of the disk is used for / and stuff
- /dev/nvme1n1p1 - 8GiB, type: “Linux swap”. Part 2 of the swap space for the system. By splitting it up, some amount of write wear is balanced I hope
- /dev/nvme1n1p2 - the rest (~886GiB), type: “Linux filesystem”. The rest of the disk is used for the main system, mirrored by btrfs in raid1.
It’s slightly bigger, so there is a slight amount of lost/wasted storage space. Still plenty!
-
Make the btrfs filesystem:
mkfs.btrfs -d raid1 -m raid1 -L archroot /dev/nvme0n1p4 /dev/nvme1n1p2then update the kernel tables to easily mount it:btrfs device scan -
Mount the filesystem:
mount /dev/disk/by-label/archroot /mnt -o relatime,compress=ztd:3 -
Time to make a bunch of subvolumes! Each of these are created by running
btrfs subvolume create /mnt/FOO- @ - The root filesystem
- @log - /var/log/, a bunch of often-changing files
- @cache - /var/cache, a bunch of temporary files
- @snapshots - Storage of snapshots taken of the root filesystem. Other subvolumes mounted within will be empty directories in the snapshot
-
Then unmount the main partition, and switch to subvolumes. Make the appropriate directories for the subvolumes and other partitions (namely, /boot)
umount /mnt mount /dev/disk/by-label/archroot /mnt -o relatime,compress=ztd:3,subvol=/@ mkdir -p /mnt/boot /mnt/var/log /mnt/var/cache /mnt/.snapshots mount /dev/nvme0n1p2 /mnt/boot mount /dev/disk/by-label/archroot /mnt/var/log -o relatime,compress=ztd:3,subvol=/@log mount /dev/disk/by-label/archroot /mnt/var/cache -o relatime,compress=ztd:3,subvol=/@cache mount /dev/disk/by-label/archroot /mnt/.snapshots -o relatime,compress=ztd:3,subvol=/@snapshots -
Turn on swap!
mkswap /dev/nvme0n1p3 mkswap /dev/nvme1n1p1 swapon /dev/nvme0n1p3 swapon /dev/nvme1n1p1 -
Here we go, the big pacstrap!
pacstrap -K /mnt base linux linux-firmware amd-ucode btrfs-progs neovim man-db terminus-font iptables-nft nftables openssh -
Then generate the fstab file:
genfstab -U /mnt >> /mnt/etc/fstab -
Copy the edited networkd configuration to the fresh machine (
cp {,/mnt}/etc/systemd/networkd/20-ethernet.network) so it’s network is successful
arch-chroot tasks
Now time to do a bunch of things within arch-chroot /mnt:
-
Set the hostname in
/etc/hostname. -
Edit
/etc/locale.gento uncomment en_US, then run locale-gen. -
Symlink
/etc/localtimeto/usr/share/zoneinfo/Etc/UTC -
Enable networkd:
systemctl enable systemd-networkd -
Enable timesyncd:
systemctl enable systemd-timesyncd -
Configure the system locale (
/etc/locale.conf):LANG=en_US.UTF-8 LC_COLLATE=C -
Configure the virtual console (though I won’t look at it that often…),
/etc/vconsole.conf:KEYMAP=us FONT=ter-v16n -
Edit
/etc/mkinitcpio.confin the following ways, then regenerate the initramfs withmkinitcpio -P- Add btrfs and crc32c to the list of modules
- Add btrfs as a binary to copy
- Swap udev with systemd hook
- Add btrfs hook after systemd, before autodetect
- Swap consolefont with sd-vconsole hook
- Make sure the microcode hook is in the list
-
Set the root password
-
Install systemd-boot via
bootctl install -
Enable a couple of maintenance services:
systemd-boot-update.serviceandbtrfs-scrub@-.timer -
Edit
/etc/ssh/sshd_configto expose root on a custom port. Then enablesshd.service. -
Configure systemd-boot by copying the example
/usr/share/systemd/bootctl/arch.confto/boot/loader/entries/ -
Done!
exitto leave the chroot, and thenumount -R /mntto unmount everything. Reboot, you should be good.
post install tasks
Some stuff still to do after the system as rebooted!
- Log in as root
- Enable systemd-resolved:
systemctl enable --now systemd-resolved && ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf - Install the grml zsh config, to make sitting at the root prompt more comfortable:
pacman -S grml-zsh-config && chsh /usr/bin/zsh - Install
pythonfor management of the machine via Ansible